package model

import (
	"time"

	"open/internal/model/field"
)

// BytedanceOpenSubApp 字节跳动授权App
type BytedanceOpenSubApp struct {
	BaseModel
	AppID                      string     `gorm:"comment:应用ID;uniqueIndex:bytedance_sub_app_id"`
	TpAppID                    string     `gorm:"comment:第三方应用ID;uniqueIndex:bytedance_sub_app_id"`
	AccessToken                string     `gorm:"comment:请求token"`
	AccessTokenExpiresAt       time.Time  `gorm:"comment:请求token过期时间"`
	RefreshToken               string     `gorm:"comment:刷新token"`
	RefreshTokenExpiresAt      time.Time  `gorm:"comment:刷新token过期时间"`
	AuthorizationCode          string     `gorm:"comment:授权码"`
	AuthorizationCodeExpiresAt time.Time  `gorm:"comment:授权码过期时间"`
	Permissions                field.JSON `gorm:"comment:权限集"`
	Status                     string     `gorm:"comment:状态 authorized unauthorized"`
}
